/*************************************************
Author: byron 
Date: 08/08/2013
Description:
Notes:
*************************************************/

#ifndef __CDaySignMgr_h__
#define __CDaySignMgr_h__

#include "CDaySignCfg.h"

class CPlayerOnlineData;
class MsgReqDaySign;
class MsgAnsDaySign;

class CDaySignMgr
{
public:
    enum CMD_DAY_SIGN_SUB_TAG
    {
        CMD_DAY_SIGN_SUB_GET_INFO = 1,        //获取信息
        CMD_DAY_SIGN_SUB_DAY_SIGN = 2,        //每日签到
        CMD_DAY_SIGN_SUB_REPAIR_SIGN = 3,     //补签
        CMD_DAY_SIGN_SUB_CONTINUE_AWARD = 4,  //领取连续签到奖励
        CMD_DAY_SIGN_SUB_ACCUMULATIVE_AWARD = 5,     //领取累计签到奖励

        CMD_DAY_SIGN_SUB_NOTIFY_INFO = 101,   //主动下发信息
    };

    CDaySignMgr()
    {
        _stDaySignCfg.Clear();
    }

    virtual ~CDaySignMgr()
    {
    }

    CDaySignCfg& GetDaySignCfg(){return _stDaySignCfg;}

    int GetDaySignInfo(CPlayerDetailInfoEx1& stPlayerDetailEx1,
            MsgAnsDaySign& stAns);

    int UpdateContinueSignData(CPlayerDetailInfoEx1& stPlayerDetailEx1);

    int PlayerSign(CPlayerDetailInfoEx1& stPlayerDetailEx1,
            MsgAnsDaySign& stAns);

    int PlayerRepairSign(CPlayerBaseInfo& stPlayerBase,
            CPlayerDetailInfoEx1& stPlayerDetailEx1, MsgAnsDaySign& stAns);

    int GetContinueAward(CPlayerDetailInfoEx1& stPlayerDetailEx1,
            CPlayerOnlineData& stPlayerOnline, MsgReqDaySign& stReq,
            MsgAnsDaySign& stAns);

    int GetAccumulateAward(CPlayerDetailInfoEx1& stPlayerDetailEx1,
            CPlayerOnlineData& stPlayerOnline, MsgReqDaySign& stReq,
            MsgAnsDaySign& stAns);

    int NotifyAllOnlineUsers();

private:
    CDaySignCfg _stDaySignCfg;
};

#endif //__CDaySignMgr_h__

